<!DOCTYPE html>
<html lang="en">
	<?php
		//检测是否登录,没登录跳转回登录界面
		$userName = null;
		$userType = null;
		session_start();
	    if(isset($_SESSION["userName"]) and isset($_SESSION["userType"])) {
	        $userName = $_SESSION["userName"];
	        $userType = $_SESSION["userType"];
	    } else { 
	    	header("location: login.php");
	    }
	?>
	<head>
		<title>调查员后台管理</title>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="icon" href="img/fav.ico" mce_href="img/fav.ico" type="image/x-icon">
		<link rel="shortcut icon" href="img/fav.ico" mce_href="img/fav.ico" type="image/x-icon">
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="css/matrix-style.css" />
		<link rel="stylesheet" href="css/matrix-media.css" />
		<link href="font-awesome/css/font-awesome.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/jquery.gritter.css" />
	</head>
<body>


<!--Header-part-->
<div id="header">
  <h1>调查员后台管理</h1>
</div>
<!--close-Header-part--> 


<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
  	<li><a href="index.php"><i class="icon icon-home"></i> <span class="text">主页</span> </a></li>
    <li><a href="dologout.php"><i class="icon icon-share-alt"></i> <span class="text">登出</span></a></li>
  </ul>
</div>
<div id="user">
	<?php
		echo '<button class="btn btn-primary"><Strong>';
		echo $userName;
		$userTypeStr = null;
		if ($userType === "qc") { 
			$userTypeStr = "QC";
		} else if($userType === "admin") { 
			$userTypeStr = "管理员";
		} else if($userType === "supervisor") { 
			$userTypeStr = "督导";
		} else if($userType === "inspecter") { 
			$userTypeStr = "调查员";
		}
		echo '-'.$userTypeStr. '</button>';
	?>
</div>
<div id="sidebar"><a href="#" class="visible-phone"><i class="icon icon-home"></i> 菜单 </a>
  <ul>
  	<?php
  		//权限菜单分配
  		if($userType === "qc" or $userType === "inspecter" or $userType === "supervisor") { 
  			echo '<li class="submenu"> <a href="#"><i class="icon icon-th-list"></i> <span>问题单</span></a><ul>';
  			if($userType === "qc") { 
      	 		echo '<li><a href="createproblem.php">创建问题单</a></li>';
      	 	}
      	 	echo '<li><a href="problemlist.php">我的问题单</a></li></ul></li>';
  		}
      	if($userType === "admin") { 
      		echo '<li class="submenu"> <a href="#"><i class="icon icon-home"></i> <span>人员管理</span></a>';
      		echo '<ul><li><a href="addpop.php">添加人员</a></li>';
      		//echo '<li><a href="#">删除人员</a></li>';
      		echo '</li></ul>';
      	}
  	?>	
  </ul>
</div>